////////////////////////////////////////////////////////////////////////////////
/// Name: common.cpp
/// Author: B. Gian James  <gian@BattleDroids.net>
/// Description: Definitions for common things.
///
// $Id: common.cpp,v 1.2 2009/08/28 22:55:17 gian Exp $
#include "common.h"
#include <string.h>
#include <stdlib.h>

uint8_t
StringCopy(char * dest, const char * source)
{
	uint8_t x;
	for (x = 0; x < strlen(source); x++)
		dest[x] = source[x];		
	dest[x] = '\0';
	return x;
}

void __cxa_pure_virtual(void) {}

void * operator new(size_t size)
{
	return malloc(size);
}

void * operator new [] (size_t size)
{
	return malloc(size);
}

void operator delete(void * ptr)
{
	if (ptr)
		free(ptr);
}

void operator delete [] (void * ptr)
{
	if (ptr)
		free(ptr);
}


uint16	XPNeeded(uint8 lvl)
{
	return ( (100*(lvl-1)) );
}

//////////////////////////// Strings
